﻿using System;

namespace YJKGridTopologyCal.Index.IntervalRTree
{
	public class IntervalRTreeLeafNode<T> : IntervalRTreeNode<T>
	{
		public IntervalRTreeLeafNode(double min, double max, T item) : base(min, max)
		{
			this._item = item;
		}

		public override void Query(double queryMin, double queryMax, IItemVisitor<T> visitor)
		{
			if (!base.Intersects(queryMin, queryMax))
			{
				return;
			}
			visitor.VisitItem(this._item);
		}

		private readonly T _item;
	}
}
